﻿using System.Linq.Expressions;

namespace Mg.ExpressionParser.Parser
{
    class UnaryExpressionParser : BaseExpressionParser<UnaryExpression>
    {
        protected override SqlPack Select(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.Select(expression.Operand, sqlPack);
            return sqlPack;
        }

        protected override SqlPack Where(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.Where(expression.Operand, sqlPack);
            return sqlPack;
        }

        protected override SqlPack GroupBy(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.GroupBy(expression.Operand, sqlPack);
            return sqlPack;
        }

        protected override SqlPack OrderBy(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.OrderBy(expression.Operand, sqlPack);
            return sqlPack;
        }

        protected override SqlPack Max(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.Max(expression.Operand, sqlPack);
            return sqlPack;
        }

        protected override SqlPack Min(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.Min(expression.Operand, sqlPack);
            return sqlPack;
        }

        protected override SqlPack Avg(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.Avg(expression.Operand, sqlPack);
            return sqlPack;
        }

        protected override SqlPack Count(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.Count(expression.Operand, sqlPack);
            return sqlPack;
        }

        protected override SqlPack Sum(UnaryExpression expression, SqlPack sqlPack)
        {
            ExpressionParserProvider.Sum(expression.Operand, sqlPack);
            return sqlPack;
        }
    }
}
